home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / create6a / frmaddfi.frm next >
Text File  |  1999-10-15  |  4KB  |  154 lines

  1. VERSION 5.00
  2. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
  3. Begin VB.Form frmAddFile 
  4.    BorderStyle     =   3  'Fixed Dialog
  5.    Caption         =   "Add File..."
  6.    ClientHeight    =   1395
  7.    ClientLeft      =   45
  8.    ClientTop       =   330
  9.    ClientWidth     =   3090
  10.    ControlBox      =   0   'False
  11.    LinkTopic       =   "Form2"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   1395
  15.    ScaleWidth      =   3090
  16.    ShowInTaskbar   =   0   'False
  17.    StartUpPosition =   2  'CenterScreen
  18.    Begin MSComDlg.CommonDialog CommonDialog1 
  19.       Left            =   2760
  20.       Top             =   1320
  21.       _ExtentX        =   847
  22.       _ExtentY        =   847
  23.       _Version        =   393216
  24.    End
  25.    Begin VB.CommandButton Command3 
  26.       Caption         =   "Cancel"
  27.       BeginProperty Font 
  28.          Name            =   "Arial"
  29.          Size            =   8.25
  30.          Charset         =   0
  31.          Weight          =   400
  32.          Underline       =   0   'False
  33.          Italic          =   0   'False
  34.          Strikethrough   =   0   'False
  35.       EndProperty
  36.       Height          =   375
  37.       Left            =   1560
  38.       TabIndex        =   5
  39.       Top             =   960
  40.       Width           =   975
  41.    End
  42.    Begin VB.CommandButton Command2 
  43.       Caption         =   "OK"
  44.       BeginProperty Font 
  45.          Name            =   "Arial"
  46.          Size            =   8.25
  47.          Charset         =   0
  48.          Weight          =   400
  49.          Underline       =   0   'False
  50.          Italic          =   0   'False
  51.          Strikethrough   =   0   'False
  52.       EndProperty
  53.       Height          =   375
  54.       Left            =   480
  55.       TabIndex        =   4
  56.       Top             =   960
  57.       Width           =   975
  58.    End
  59.    Begin VB.TextBox txtdescription 
  60.       Appearance      =   0  'Flat
  61.       Height          =   285
  62.       Left            =   1320
  63.       TabIndex        =   3
  64.       Top             =   480
  65.       Width           =   1695
  66.    End
  67.    Begin VB.TextBox txtPath 
  68.       Appearance      =   0  'Flat
  69.       BackColor       =   &H00C0C0C0&
  70.       Height          =   285
  71.       Left            =   1320
  72.       Locked          =   -1  'True
  73.       TabIndex        =   1
  74.       Top             =   120
  75.       Width           =   1695
  76.    End
  77.    Begin VB.CommandButton Command1 
  78.       Caption         =   "Browse..."
  79.       BeginProperty Font 
  80.          Name            =   "Arial"
  81.          Size            =   8.25
  82.          Charset         =   0
  83.          Weight          =   400
  84.          Underline       =   0   'False
  85.          Italic          =   0   'False
  86.          Strikethrough   =   0   'False
  87.       EndProperty
  88.       Height          =   255
  89.       Left            =   120
  90.       TabIndex        =   0
  91.       Top             =   120
  92.       Width           =   1095
  93.    End
  94.    Begin VB.Label Label2 
  95.       Caption         =   "Description:"
  96.       BeginProperty Font 
  97.          Name            =   "Arial"
  98.          Size            =   8.25
  99.          Charset         =   0
  100.          Weight          =   400
  101.          Underline       =   0   'False
  102.          Italic          =   0   'False
  103.          Strikethrough   =   0   'False
  104.       EndProperty
  105.       Height          =   255
  106.       Left            =   240
  107.       TabIndex        =   2
  108.       Top             =   480
  109.       Width           =   855
  110.    End
  111. End
  112. Attribute VB_Name = "frmAddFile"
  113. Attribute VB_GlobalNameSpace = False
  114. Attribute VB_Creatable = False
  115. Attribute VB_PredeclaredId = True
  116. Attribute VB_Exposed = False
  117. Private Sub Command1_Click()
  118. CommonDialog1.Filter = "Executable Files (*.exe)|*.exe"
  119. CommonDialog1.ShowOpen
  120. txtPath.Text = CommonDialog1.FileName
  121.  
  122. End Sub
  123.  
  124. Private Sub Command2_Click()
  125.  
  126. 'Specifies the of the file in witch save your settings
  127. iniPath$ = App.Path & "\progmansav.ini"
  128.  
  129. 'This saves the description of the file you selected
  130. entry$ = txtdescription.Text
  131. r% = WritePrivateProfileString("Program" & frmMain.List1.ListCount + 1, "Description", entry$, iniPath$)
  132.  
  133. 'This saves the path to the file
  134. entry$ = txtPath.Text
  135. r% = WritePrivateProfileString("Program" & frmMain.List1.ListCount + 1, "Path", entry$, iniPath$)
  136. frmMain.List1.AddItem txtdescription.Text
  137.  
  138. Unload Me
  139.  
  140. End Sub
  141.  
  142. Private Sub Command3_Click()
  143.  
  144. Unload Me
  145.  
  146. End Sub
  147.  
  148.  
  149. Private Sub Form_Load()
  150.  
  151. End Sub
  152.  
  153.  
  154.